#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <math.h>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
int strStr(string haystack, string needle) {
    if(needle=="")return 0;
    short size1=haystack.size(),
    size2=needle.size();
    for(short i=0;i<=size1-size2;i++){
        if(haystack.substr(i,size2)==needle)return i;
    }
    return -1;
}
int main(){

cout<<strStr("haystack","")<<endl;


    return 0;
}